<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>VUE学习 - POST API</title>
</head>

<body>


    <!--载入vue.js-->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>

    <div id="Application">

        您的名字是：{{data.name}} <br />
        您的ID是：{{data.id}}

    </div>
    <script>
        const app = Vue.createApp({
            setup() {
                const data = Vue.ref("");

                //待传输数据
                let data_meat = { msg: "成功啦！" }

                axios({
                    method: 'post',
                    url: 'https://rouse.npc.ink/api/data.php',
                    data: data_meat//传输的数据
                })
                    .then(response => {
                        data.value = response.data;
                    })

                return { data };

            },
        })

        app.mount("#Application")
    </script>

</body>

</html>